<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  $_SESSION['s_urlRedirectDir'] = $_SERVER['REQUEST_URI'];
  header("Location:checkLogin.php");
}
else
{	
  $query1 = "DELETE incoming.*,incomingdetail.*,planning.*,logsheet.*,outgoingmaster.*,billdetail.*,billmaster.*
               FROM incoming
               LEFT JOIN incomingdetail ON incoming.incomingId = incomingdetail.incomingId
               LEFT JOIN planning       ON incoming.incomingId = planning.incomingId
               LEFT JOIN logsheet       ON incoming.incomingId = logsheet.incomingId
               LEFT JOIN outgoingmaster ON incoming.incomingId = outgoingmaster.incomingId
               LEFT JOIN billdetail     ON outgoingmaster.outGoingMasterId = billdetail.outGoingMasterId
               LEFT JOIN billmaster     ON billdetail.billMasterId = billmaster.billMasterId
	            WHERE incoming.incomingId = ".$_REQUEST['incomingId'];
	$result1= mysql_query($query1);

	header("Location:incomingRegister.php");
}
?>